from openpyxl import load_workbook
workbook= load_workbook(filename='D:\\sms\\python02\\工作.xlsx')
sheet= workbook['Sheet2']
# sheet=workbook.active
cells=sheet['A1:A5']
# print(workbook.sheetnames)
# print(sheet.dimensions)
# print(cell.value)
# print(cell.row,cell.column,cell.coordinate)
# print(cells)
# .iter_rows(min_romw,max_row,min_col,max_col) 循环按行
# .iter_cols(min_romw,max_row,min_col,max_col)循环按列
#.rows 所有行 .cols所有列
for row in sheet.iter_rows(min_row=1,max_row=3,min_col=1,max_col=2):
    for cell in row:
        print(cell.value)
# cell:value,row,column,coordinate


   